{include file="public/base" /}
{block name="main"}
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>编辑认证信息</h5>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content">
                    <form method="get" action="javascript:;" class="form-horizontal">
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">用户名</label>
                            <div class="col-sm-10">
                                <input name="nickname" type="text" class="form-control" value="{$data.nickname}" readonly="readonly"/>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">真实姓名</label>
                            <div class="col-sm-10">
                                <input name="mail" type="text" class="form-control" value="{$data.name}" readonly="readonly"/>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">身份证号</label>
                            <div class="col-sm-10">
                                <input name="phone" type="text" class="form-control" value="{$data.card}" readonly="readonly"/>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">认证状态</label>
                            <div class="col-sm-10">
                                <input name="flg" type="radio" value="0" {if $data.flg==0}checked{/if}/>等待审核
                                <input name="flg" type="radio" value="1" {if $data.flg==1}checked{/if}/>已认证
								<input name="flg" type="radio" value="2" {if $data.flg==2}checked{/if}/>已驳回
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">认证时间</label>
                            <div class="col-sm-10">
                                <input name="createtime" type="text" class="form-control" value="{$data['realtime']|date='Y-m-d H:i:s',###}" readonly="readonly"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-2">
                                <input name="id" type="hidden" value="{$data.id}"/>
                                <button class="btn btn-primary" type="submit" onclick="add()">保存内容</button>
                                <div class="btn btn-white" id="backs">取消</div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{/block}
{block name="javascript"}
<script src="ADMIN_JS/content.min.js?v=1.0.0"></script>
<script src="ADMIN_JS/plugins/iCheck/icheck.min.js"></script>
<script>
    function add()
    {
        var formData = new FormData();
        var flg = $('input[name="flg"]:checked').val();
        var id = $("[name='id']").val();

        formData.append("flg",flg);
        formData.append("id",id);
        var url = '{:url("realname/edit")}';
        var loading = layer.msg('正在提交数据，请稍后...', {icon: 16,time:6000});
        $.ajax({
            type:'post',
            url:url,
            data:formData,
            contentType: false,
            processData: false,
            success:function(data){
                layer.close(loading);
                if(data.code==1){
                    layer.msg(data.message,{icon:6,time:1500});
                    setTimeout(function(){window.parent.location.reload();},1000);
                }else{
                    layer.msg(data.message,{icon:5,time:1500});
                }
            }
        })
    }
    $("#backs").click(function(){
        var index = parent.layer.getFrameIndex(window.name);
        parent.layer.close(index);
    })

</script>
{/block}